@SETLOCAL
@ECHO OFF

SET Server=ericleb

ECHO Stopping the DnSvc10 service...
sc \\%Server% stop DnSvc10 > nul
:StopWait
sc \\%Server% interrogate DnSvc10 > nul
IF "%errorlevel%"=="1061" GOTO StopWait

ECHO Starting the HomeUX service...
sc \\%Server% start HomeUX > nul
:StartWait
sc \\%Server% continue HomeUX > nul
IF "%errorlevel%"=="1061" GOTO StartWait
IF "%errorlevel%"=="1062" GOTO StartWait

sc \\%Server% interrogate HomeUX

ECHO Done.

